// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_INV_STORAGE
// * CreateDate    : 2012/11/1 13:50:50
// * Creater       : InvStorageEntity
// * LastChangeDate: 2012/11/1 13:50:50
// * LastChanger   : 2012/11/1 13:50:50
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;

namespace ESOL.Common.Entity
{
    [Serializable]
    public partial class InvStorageEntity : EntityBase
    {
        public InvStorageTable TableSchema
        {
            get
            {
                return InvStorageTable.Current;
            }
        }

        public InvStorageEntity()
        {

        }

        public InvStorageEntity(DataRow dr)
        {
            if (dr == null)
            {
                return;
            }
            this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
            this.LocationId = Convert.ToString(CommonFunctions.ToObject(dr["LOCATION_ID"]));
            this.CurrentQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["CURRENT_QTY"]));
            this.FixedQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["FIXED_QTY"]));
            this.LastRelatedOrder = Convert.ToString(CommonFunctions.ToObject(dr["LAST_RELATED_ORDER"]));
            this.LastUpdateDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["LAST_UPDATE_DATE"]));
            this.LastModifiedBy = Convert.ToString(CommonFunctions.ToObject(dr["LAST_MODIFIED_BY"]));
        }

        public InvStorageEntity(DataRowView dr)
        {
            if (dr == null)
            {
                return;
            }
            this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
            this.LocationId = Convert.ToString(CommonFunctions.ToObject(dr["LOCATION_ID"]));
            this.CurrentQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["CURRENT_QTY"]));
            this.FixedQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["FIXED_QTY"]));
            this.LastRelatedOrder = Convert.ToString(CommonFunctions.ToObject(dr["LAST_RELATED_ORDER"]));
            this.LastUpdateDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["LAST_UPDATE_DATE"]));
            this.LastModifiedBy = Convert.ToString(CommonFunctions.ToObject(dr["LAST_MODIFIED_BY"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return InvStorageTable.Current;
            }
        }

        #region Perporty List
        public string ProductId
        {
            get { return Convert.ToString(GetData(InvStorageTable.C_PRODUCT_ID)); }
            set { SetData(InvStorageTable.C_PRODUCT_ID, value); }
        }

        public string LocationId
        {
            get { return Convert.ToString(GetData(InvStorageTable.C_LOCATION_ID)); }
            set { SetData(InvStorageTable.C_LOCATION_ID, value); }
        }

        public decimal CurrentQty
        {
            get { return Convert.ToDecimal(GetData(InvStorageTable.C_CURRENT_QTY)); }
            set { SetData(InvStorageTable.C_CURRENT_QTY, value); }
        }

        public decimal FixedQty
        {
            get { return Convert.ToDecimal(GetData(InvStorageTable.C_FIXED_QTY)); }
            set { SetData(InvStorageTable.C_FIXED_QTY, value); }
        }

        public string LastRelatedOrder
        {
            get { return Convert.ToString(GetData(InvStorageTable.C_LAST_RELATED_ORDER)); }
            set { SetData(InvStorageTable.C_LAST_RELATED_ORDER, value); }
        }

        public DateTime LastUpdateDate
        {
            get { return Convert.ToDateTime(GetData(InvStorageTable.C_LAST_UPDATE_DATE)); }
            set { SetData(InvStorageTable.C_LAST_UPDATE_DATE, value); }
        }

        public string LastModifiedBy
        {
            get { return Convert.ToString(GetData(InvStorageTable.C_LAST_MODIFIED_BY)); }
            set { SetData(InvStorageTable.C_LAST_MODIFIED_BY, value); }
        }

        #endregion
    }


}

